<?php

class Core_Model_DbTable_ServicesDetail extends Zend_Db_Table_Abstract {

    protected $_name = 'services_detail';

    public function getByGIID($gi_id) {
        $select = $this->select()
                       ->from("$this->_name as de")
                       ->setIntegrityCheck(false)
                       ->joinLeft("services as ser", "ser.id = de.service", array("name", "created_time"))
                       ->where("de.gi_id = $gi_id");
        return $this->fetchAll($select);
    }
    
    public function get($ids) {
        $cond = $this->getAdapter()->quoteInto("ser_detail.id IN (?)", $ids);
        $query = $this->select()
                     ->from("{$this->_name} as ser_detail")
                     ->setIntegrityCheck(false)
                     ->join("services as ser", "ser.id = ser_detail.service", array("ser.name as service_name"))
                     ->where($cond);
        return $this->fetchAll($query);
    }
    
    
}

?>
